//	---------------------------------------------------------------------------
//	dark-matter-data
//	Copyright (c) 2014 dark-matter-data committers
//	---------------------------------------------------------------------------
//	This program is free software; you can redistribute it and/or modify it
//	under the terms of the GNU Lesser General Public License as published by the
//	Free Software Foundation; either version 3 of the License, or (at your
//	option) any later version.
//	This program is distributed in the hope that it will be useful, but WITHOUT
//	ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
//	FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
//	more details.
//	You should have received a copy of the GNU Lesser General Public License along
//	with this program; if not, see <http://www.gnu.org/licenses/lgpl.html>.
//	---------------------------------------------------------------------------
package org.dmd.wsdl.shared.generated.dmo;

// Generated from: org.dmd.dms.util.GenUtility.formatImports(GenUtility.java:396)
import java.io.Serializable;                                                          // Always required - (GenUtility.java:224)
import java.util.*;                                                                   // Always required if we have any MV attributes - (GenUtility.java:221)
import org.dmd.dmc.DmcAttribute;                                                      // Named object - (GenUtility.java:376)
import org.dmd.dmc.DmcNamedObjectIF;                                                  // Named object - (GenUtility.java:375)
import org.dmd.dmc.DmcSliceInfo;                                                      // Required for object slicing - (GenUtility.java:229)
import org.dmd.dmc.DmcValueException;                                                 // Any attributes - (GenUtility.java:241)
import org.dmd.dmc.types.DefinitionName;                                              // Naming attribute type - (GenUtility.java:370)
import org.dmd.dms.generated.dmo.MetaDMSAG;                                           // Required for MODREC constructor - (GenUtility.java:228)
import org.dmd.dms.generated.types.DmcTypeDefinitionNameSV;                           // Required type - (GenUtility.java:328)
import org.dmd.dms.generated.types.DmcTypeModifierMV;                                 // Required for MODREC constructor - (GenUtility.java:227)
import org.dmd.dms.generated.types.DmcTypeStringSV;                                   // Required type - (GenUtility.java:328)
import org.dmd.wsdl.shared.generated.dmo.WsdlDefinitionDMO;                           // Base class - (GenUtility.java:355)
import org.dmd.wsdl.shared.generated.types.DmcTypeLabelledElementReferenceMV;         // Required type - (GenUtility.java:328)
import org.dmd.wsdl.shared.generated.types.DmcTypeLabelledFaultReferenceMV;           // Required type - (GenUtility.java:328)
import org.dmd.wsdl.shared.generated.types.LabelledElementReference;                  // Primitive type and !auxiliary class - (GenUtility.java:271)
import org.dmd.wsdl.shared.generated.types.LabelledFaultReference;                    // Primitive type and !auxiliary class - (GenUtility.java:271)

// Generated from: org.dmd.dms.util.DmoFormatter.getClassHeader(DmoFormatter.java:677)
/**
 * Each WsdlOperation specifies the types of messages that the service can
 * send or receive as\n part of that operation. Each operation also specifies
 * a message exchange pattern that indicates the sequence\n in which the
 * associated messages are to be transmitted between the parties.
 * <P>
 * Generated from the dmwsdl schema at version unknown
 * <P>
 * This code was auto-generated by the dmogenerator utility and shouldn't be alterred manually!
 * Generated from: org.dmd.dms.util.DmoFormatter.dumpDMO(DmoFormatter.java:133)
 */
@SuppressWarnings("serial")
public class WsdlOperationDMO  extends WsdlDefinitionDMO  implements DmcNamedObjectIF, Serializable  {

    public final static String constructionClassName = "WsdlOperation";


    static {
    }

    public WsdlOperationDMO() {
        super("WsdlOperation");
    }

    protected WsdlOperationDMO(String oc) {
        super(oc);
    }

    @Override
    public WsdlOperationDMO getNew(){
        WsdlOperationDMO rc = new WsdlOperationDMO();
        return(rc);
    }

    @Override
    public WsdlOperationDMO getSlice(DmcSliceInfo info){
        WsdlOperationDMO rc = new WsdlOperationDMO();
        populateSlice(rc,info);
        return(rc);
    }

    public WsdlOperationDMO(DmcTypeModifierMV mods) {
        super("WsdlOperation");
        modrec(true);
        setModifier(mods);
    }

    public WsdlOperationDMO getModificationRecorder(){
        WsdlOperationDMO rc = new WsdlOperationDMO();
        rc.setName(getName());
        rc.setModifier(new DmcTypeModifierMV(MetaDMSAG.__modify));
        rc.modrec(true);
        return(rc);
    }

    // org.dmd.dms.util.DmoFormatter.getAccessFunctions(DmoFormatter.java:751)
    public DefinitionName getObjectName(){
        DmcAttribute<?> name = get(MetaDMSAG.__name);
        if (name != null)
            return((DefinitionName)name.getSV());
    
        return(null);
    }

    // org.dmd.dms.util.DmoFormatter.getAccessFunctions(DmoFormatter.java:768)
    public DmcAttribute<?> getObjectNameAttribute(){
        DmcAttribute<?> name = get(MetaDMSAG.__name);
        return(name);
    }

    // org.dmd.dms.util.DmoFormatter.getAccessFunctions(DmoFormatter.java:775)
    public boolean equals(Object obj){
        if (obj instanceof WsdlOperationDMO){
            return( getObjectName().equals( ((WsdlOperationDMO) obj).getObjectName()) );
        }
        return(false);
    }

    // org.dmd.dms.util.DmoFormatter.getAccessFunctions(DmoFormatter.java:783)
    public int hashCode(){
        DefinitionName objn = getObjectName();
        if (objn == null)
            return(0);
        
        return(objn.hashCode());
    }

    // org.dmd.dms.util.GenUtility.formatSV(GenUtility.java:784)
    public String getPattern(){
        DmcTypeStringSV attr = (DmcTypeStringSV) get(DmwsdlDMSAG.__pattern);
        if (attr == null)
            return(null);

        return(attr.getSV());
    }

    /**
     * Sets pattern to the specified value.
     * @param value String
     */
    // org.dmd.dms.util.GenUtility.formatSV(GenUtility.java:824)
    public void setPattern(String value) {
        DmcAttribute<?> attr = get(DmwsdlDMSAG.__pattern);
        if (attr == null)
            attr = new DmcTypeStringSV(DmwsdlDMSAG.__pattern);
        
        try{
            attr.set(value);
            set(DmwsdlDMSAG.__pattern,attr);
        }
        catch(DmcValueException ex){
            throw(new IllegalStateException("The type specific set() method shouldn't throw exceptions!",ex));
        }
    }

    /**
     * Sets pattern to the specified value.
     * @param value A value compatible with DmcTypeStringSV
     */
    // org.dmd.dms.util.GenUtility.formatSV(GenUtility.java:877)
    public void setPattern(Object value) throws DmcValueException {
        DmcTypeStringSV attr  = (DmcTypeStringSV) get(DmwsdlDMSAG.__pattern);
        if (attr == null)
            attr = new DmcTypeStringSV(DmwsdlDMSAG.__pattern);
        
        attr.set(value);
        set(DmwsdlDMSAG.__pattern,attr);
    }

    /**
     * Removes the pattern attribute value.
     */
    // org.dmd.dms.util.GenUtility.formatSV(GenUtility.java:897)
    public void remPattern(){
         rem(DmwsdlDMSAG.__pattern);
    }

    // org.dmd.dms.util.GenUtility.formatSV(GenUtility.java:784)
    public String getStyle(){
        DmcTypeStringSV attr = (DmcTypeStringSV) get(DmwsdlDMSAG.__style);
        if (attr == null)
            return(null);

        return(attr.getSV());
    }

    /**
     * Sets style to the specified value.
     * @param value String
     */
    // org.dmd.dms.util.GenUtility.formatSV(GenUtility.java:824)
    public void setStyle(String value) {
        DmcAttribute<?> attr = get(DmwsdlDMSAG.__style);
        if (attr == null)
            attr = new DmcTypeStringSV(DmwsdlDMSAG.__style);
        
        try{
            attr.set(value);
            set(DmwsdlDMSAG.__style,attr);
        }
        catch(DmcValueException ex){
            throw(new IllegalStateException("The type specific set() method shouldn't throw exceptions!",ex));
        }
    }

    /**
     * Sets style to the specified value.
     * @param value A value compatible with DmcTypeStringSV
     */
    // org.dmd.dms.util.GenUtility.formatSV(GenUtility.java:877)
    public void setStyle(Object value) throws DmcValueException {
        DmcTypeStringSV attr  = (DmcTypeStringSV) get(DmwsdlDMSAG.__style);
        if (attr == null)
            attr = new DmcTypeStringSV(DmwsdlDMSAG.__style);
        
        attr.set(value);
        set(DmwsdlDMSAG.__style,attr);
    }

    /**
     * Removes the style attribute value.
     */
    // org.dmd.dms.util.GenUtility.formatSV(GenUtility.java:897)
    public void remStyle(){
         rem(DmwsdlDMSAG.__style);
    }

    /**
     * @return An Iterator of LabelledElementReference objects.
     */
    @SuppressWarnings("unchecked")
    // org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1112)
    public Iterator<LabelledElementReference> getInput(){
        DmcTypeLabelledElementReferenceMV attr = (DmcTypeLabelledElementReferenceMV) get(DmwsdlDMSAG.__input);
        if (attr == null)
            return( ((List<LabelledElementReference>) Collections.EMPTY_LIST).iterator());

        return(attr.getMV());
    }

    /**
     * @return The nth LabelledElementReference value.
     */
    // org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1124)
    public LabelledElementReference getNthInput(int i){
        DmcTypeLabelledElementReferenceMV attr = (DmcTypeLabelledElementReferenceMV) get(DmwsdlDMSAG.__input);
        if (attr == null)
            return(null);

        return(attr.getMVnth(i));
    }

    /**
     * Adds another input to the specified value.
     * @param value LabelledElementReference
     */
    // org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1138)
    public DmcAttribute<?> addInput(LabelledElementReference value) {
        DmcAttribute<?> attr = get(DmwsdlDMSAG.__input);
        if (attr == null)
            attr = new DmcTypeLabelledElementReferenceMV(DmwsdlDMSAG.__input);
        
        try{
            setLastValue(attr.add(value));
            add(DmwsdlDMSAG.__input,attr);
        }
        catch(DmcValueException ex){
            throw(new IllegalStateException("The type specific add() method shouldn't throw exceptions!",ex));
        }
        return(attr);
    }

    /**
     * Returns true if we contain a valued keyed by the specified LabelledElementReference.
     * @param value LabelledElementReference
     */
    // org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1213)
    public boolean inputContains(LabelledElementReference value) {
        DmcAttribute<?> attr = get(DmwsdlDMSAG.__input);
        if (attr == null)
            return(false);
        return(attr.contains(value));
    }

    /**
     * Adds another input value.
     * @param value A value compatible with LabelledElementReference
     */
    // org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1245)
    public DmcAttribute<?> addInput(Object value) throws DmcValueException {
        DmcAttribute<?> attr = get(DmwsdlDMSAG.__input);
        if (attr == null)
            attr = new DmcTypeLabelledElementReferenceMV(DmwsdlDMSAG.__input);
        
        setLastValue(attr.add(value));
        add(DmwsdlDMSAG.__input,attr);
        return(attr);
    }

    /**
     * Returns the number of values in input
     */
    // org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1262)
    public int getInputSize(){
        DmcAttribute<?> attr = get(DmwsdlDMSAG.__input);
        if (attr == null){
            if (DmwsdlDMSAG.__input.indexSize == 0)
                return(0);
            else
                return(DmwsdlDMSAG.__input.indexSize);
        }
        return(attr.getMVSize());
    }

    /**
     * Deletes a input value.
     * @param value The LabelledElementReference to be deleted from set of attribute values.
     */
    // org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1320)
    public DmcAttribute<?> delInput(Object value) throws DmcValueException {
        DmcAttribute<?> attr = get(DmwsdlDMSAG.__input);
        
        if ( (attr == null) && (getModifier()!= null))
            delFromEmptyAttribute(new DmcTypeLabelledElementReferenceMV(DmwsdlDMSAG.__input), value);
        else
            attr = del(DmwsdlDMSAG.__input, value);
        
        return(attr);
    }

    /**
     * Deletes a input from the specified value.
     * @param value LabelledElementReference
     */
    // org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1336)
    public DmcAttribute<?> delInput(LabelledElementReference value) {
        DmcAttribute<?> attr = get(DmwsdlDMSAG.__input);
        
        if ( (attr == null) && (getModifier()!= null))
            delFromEmptyAttribute(new DmcTypeLabelledElementReferenceMV(DmwsdlDMSAG.__input), value);
        else
            attr = del(DmwsdlDMSAG.__input, value);
        
        return(attr);
    }

    /**
     * Removes the input attribute value.
     */
    // org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1355)
    public void remInput(){
         rem(DmwsdlDMSAG.__input);
    }

    /**
     * @return An Iterator of LabelledElementReference objects.
     */
    @SuppressWarnings("unchecked")
    // org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1112)
    public Iterator<LabelledElementReference> getOutput(){
        DmcTypeLabelledElementReferenceMV attr = (DmcTypeLabelledElementReferenceMV) get(DmwsdlDMSAG.__output);
        if (attr == null)
            return( ((List<LabelledElementReference>) Collections.EMPTY_LIST).iterator());

        return(attr.getMV());
    }

    /**
     * @return The nth LabelledElementReference value.
     */
    // org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1124)
    public LabelledElementReference getNthOutput(int i){
        DmcTypeLabelledElementReferenceMV attr = (DmcTypeLabelledElementReferenceMV) get(DmwsdlDMSAG.__output);
        if (attr == null)
            return(null);

        return(attr.getMVnth(i));
    }

    /**
     * Adds another output to the specified value.
     * @param value LabelledElementReference
     */
    // org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1138)
    public DmcAttribute<?> addOutput(LabelledElementReference value) {
        DmcAttribute<?> attr = get(DmwsdlDMSAG.__output);
        if (attr == null)
            attr = new DmcTypeLabelledElementReferenceMV(DmwsdlDMSAG.__output);
        
        try{
            setLastValue(attr.add(value));
            add(DmwsdlDMSAG.__output,attr);
        }
        catch(DmcValueException ex){
            throw(new IllegalStateException("The type specific add() method shouldn't throw exceptions!",ex));
        }
        return(attr);
    }

    /**
     * Returns true if we contain a valued keyed by the specified LabelledElementReference.
     * @param value LabelledElementReference
     */
    // org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1213)
    public boolean outputContains(LabelledElementReference value) {
        DmcAttribute<?> attr = get(DmwsdlDMSAG.__output);
        if (attr == null)
            return(false);
        return(attr.contains(value));
    }

    /**
     * Adds another output value.
     * @param value A value compatible with LabelledElementReference
     */
    // org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1245)
    public DmcAttribute<?> addOutput(Object value) throws DmcValueException {
        DmcAttribute<?> attr = get(DmwsdlDMSAG.__output);
        if (attr == null)
            attr = new DmcTypeLabelledElementReferenceMV(DmwsdlDMSAG.__output);
        
        setLastValue(attr.add(value));
        add(DmwsdlDMSAG.__output,attr);
        return(attr);
    }

    /**
     * Returns the number of values in output
     */
    // org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1262)
    public int getOutputSize(){
        DmcAttribute<?> attr = get(DmwsdlDMSAG.__output);
        if (attr == null){
            if (DmwsdlDMSAG.__output.indexSize == 0)
                return(0);
            else
                return(DmwsdlDMSAG.__output.indexSize);
        }
        return(attr.getMVSize());
    }

    /**
     * Deletes a output value.
     * @param value The LabelledElementReference to be deleted from set of attribute values.
     */
    // org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1320)
    public DmcAttribute<?> delOutput(Object value) throws DmcValueException {
        DmcAttribute<?> attr = get(DmwsdlDMSAG.__output);
        
        if ( (attr == null) && (getModifier()!= null))
            delFromEmptyAttribute(new DmcTypeLabelledElementReferenceMV(DmwsdlDMSAG.__output), value);
        else
            attr = del(DmwsdlDMSAG.__output, value);
        
        return(attr);
    }

    /**
     * Deletes a output from the specified value.
     * @param value LabelledElementReference
     */
    // org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1336)
    public DmcAttribute<?> delOutput(LabelledElementReference value) {
        DmcAttribute<?> attr = get(DmwsdlDMSAG.__output);
        
        if ( (attr == null) && (getModifier()!= null))
            delFromEmptyAttribute(new DmcTypeLabelledElementReferenceMV(DmwsdlDMSAG.__output), value);
        else
            attr = del(DmwsdlDMSAG.__output, value);
        
        return(attr);
    }

    /**
     * Removes the output attribute value.
     */
    // org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1355)
    public void remOutput(){
         rem(DmwsdlDMSAG.__output);
    }

    /**
     * @return An Iterator of LabelledFaultReference objects.
     */
    @SuppressWarnings("unchecked")
    // org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1112)
    public Iterator<LabelledFaultReference> getOutfault(){
        DmcTypeLabelledFaultReferenceMV attr = (DmcTypeLabelledFaultReferenceMV) get(DmwsdlDMSAG.__outfault);
        if (attr == null)
            return( ((List<LabelledFaultReference>) Collections.EMPTY_LIST).iterator());

        return(attr.getMV());
    }

    /**
     * @return The nth LabelledFaultReference value.
     */
    // org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1124)
    public LabelledFaultReference getNthOutfault(int i){
        DmcTypeLabelledFaultReferenceMV attr = (DmcTypeLabelledFaultReferenceMV) get(DmwsdlDMSAG.__outfault);
        if (attr == null)
            return(null);

        return(attr.getMVnth(i));
    }

    /**
     * Adds another outfault to the specified value.
     * @param value LabelledFaultReference
     */
    // org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1138)
    public DmcAttribute<?> addOutfault(LabelledFaultReference value) {
        DmcAttribute<?> attr = get(DmwsdlDMSAG.__outfault);
        if (attr == null)
            attr = new DmcTypeLabelledFaultReferenceMV(DmwsdlDMSAG.__outfault);
        
        try{
            setLastValue(attr.add(value));
            add(DmwsdlDMSAG.__outfault,attr);
        }
        catch(DmcValueException ex){
            throw(new IllegalStateException("The type specific add() method shouldn't throw exceptions!",ex));
        }
        return(attr);
    }

    /**
     * Returns true if we contain a valued keyed by the specified LabelledFaultReference.
     * @param value LabelledFaultReference
     */
    // org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1213)
    public boolean outfaultContains(LabelledFaultReference value) {
        DmcAttribute<?> attr = get(DmwsdlDMSAG.__outfault);
        if (attr == null)
            return(false);
        return(attr.contains(value));
    }

    /**
     * Adds another outfault value.
     * @param value A value compatible with LabelledFaultReference
     */
    // org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1245)
    public DmcAttribute<?> addOutfault(Object value) throws DmcValueException {
        DmcAttribute<?> attr = get(DmwsdlDMSAG.__outfault);
        if (attr == null)
            attr = new DmcTypeLabelledFaultReferenceMV(DmwsdlDMSAG.__outfault);
        
        setLastValue(attr.add(value));
        add(DmwsdlDMSAG.__outfault,attr);
        return(attr);
    }

    /**
     * Returns the number of values in outfault
     */
    // org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1262)
    public int getOutfaultSize(){
        DmcAttribute<?> attr = get(DmwsdlDMSAG.__outfault);
        if (attr == null){
            if (DmwsdlDMSAG.__outfault.indexSize == 0)
                return(0);
            else
                return(DmwsdlDMSAG.__outfault.indexSize);
        }
        return(attr.getMVSize());
    }

    /**
     * Deletes a outfault value.
     * @param value The LabelledFaultReference to be deleted from set of attribute values.
     */
    // org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1320)
    public DmcAttribute<?> delOutfault(Object value) throws DmcValueException {
        DmcAttribute<?> attr = get(DmwsdlDMSAG.__outfault);
        
        if ( (attr == null) && (getModifier()!= null))
            delFromEmptyAttribute(new DmcTypeLabelledFaultReferenceMV(DmwsdlDMSAG.__outfault), value);
        else
            attr = del(DmwsdlDMSAG.__outfault, value);
        
        return(attr);
    }

    /**
     * Deletes a outfault from the specified value.
     * @param value LabelledFaultReference
     */
    // org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1336)
    public DmcAttribute<?> delOutfault(LabelledFaultReference value) {
        DmcAttribute<?> attr = get(DmwsdlDMSAG.__outfault);
        
        if ( (attr == null) && (getModifier()!= null))
            delFromEmptyAttribute(new DmcTypeLabelledFaultReferenceMV(DmwsdlDMSAG.__outfault), value);
        else
            attr = del(DmwsdlDMSAG.__outfault, value);
        
        return(attr);
    }

    /**
     * Removes the outfault attribute value.
     */
    // org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1355)
    public void remOutfault(){
         rem(DmwsdlDMSAG.__outfault);
    }

    // org.dmd.dms.util.GenUtility.formatSV(GenUtility.java:784)
    public DefinitionName getName(){
        DmcTypeDefinitionNameSV attr = (DmcTypeDefinitionNameSV) get(MetaDMSAG.__name);
        if (attr == null)
            return(null);

        return(attr.getSV());
    }

    /**
     * Sets name to the specified value.
     * @param value DefinitionName
     */
    // org.dmd.dms.util.GenUtility.formatSV(GenUtility.java:824)
    public void setName(DefinitionName value) {
        DmcAttribute<?> attr = get(MetaDMSAG.__name);
        if (attr == null)
            attr = new DmcTypeDefinitionNameSV(MetaDMSAG.__name);
        
        try{
            attr.set(value);
            set(MetaDMSAG.__name,attr);
        }
        catch(DmcValueException ex){
            throw(new IllegalStateException("The type specific set() method shouldn't throw exceptions!",ex));
        }
    }

    /**
     * Sets name to the specified value.
     * @param value A value compatible with DmcTypeDefinitionNameSV
     */
    // org.dmd.dms.util.GenUtility.formatSV(GenUtility.java:877)
    public void setName(Object value) throws DmcValueException {
        DmcTypeDefinitionNameSV attr  = (DmcTypeDefinitionNameSV) get(MetaDMSAG.__name);
        if (attr == null)
            attr = new DmcTypeDefinitionNameSV(MetaDMSAG.__name);
        
        attr.set(value);
        set(MetaDMSAG.__name,attr);
    }

    /**
     * Removes the name attribute value.
     */
    // org.dmd.dms.util.GenUtility.formatSV(GenUtility.java:897)
    public void remName(){
         rem(MetaDMSAG.__name);
    }




}
